package com.ryskoo.catering.vendortemplatereldetail.service;

import com.ryskoo.catering.vendortemplatereldetail.domain.VendorTemplateRelDetailPO;
import com.ryskoo.catering.vendortemplatereldetail.repository.IVendorTemplateRelDetailRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
@Transactional
public class VendorTemplateRelDetailServiceImpl extends BasicServiceImpl<VendorTemplateRelDetailPO> implements IVendorTemplateRelDetailService {
    @Autowired
    private IVendorTemplateRelDetailRepository vendorTemplateRelDetailRepository;

    @PostConstruct
    public void init() {
        this.setDao(vendorTemplateRelDetailRepository);
    }

    @Override
    public void changeStatus(String detailUuid, boolean status) {
        vendorTemplateRelDetailRepository.changeStatus(detailUuid, status);
    }

    @Override
    public List<VendorTemplateRelDetailPO> getByMainUuid(String mainUuid, boolean useStatus, boolean status) {
        return vendorTemplateRelDetailRepository.getByMainUuid(mainUuid, useStatus, status);
    }
}
